How to Install Anaconda Python Distribution on Debian 11 | 您所在的位置:网站首页 › python 310 install › How to Install Anaconda Python Distribution on Debian 11 |
How to Install Anaconda Python Distribution on Debian 11
This tutorial exists for these OS versions
Debian 11 (Bullseye)Debian 10 (Buster) On this page
Prerequisites
Install Anaconda
How to Use Anaconda
How to Create Anaconda Environments
Uninstall Anaconda
Conclusion
Python is an open-source and object-oriented interpreted programming language. Anaconda is a Python, R, Data Science, and machine learning platform and used as a package manager. It comes with 1,500+ open source packages with free community support. It is used by more than 15 million users around the globe. This tutorial will show you how to install and use Anaconda Python Distribution on Debian 11. Prerequisites A server running Debian 11. A root password is configured on the server. Install AnacondaThe simple and easiest way to install Anaconda is to download the latest Anaconda installer bash script. First, go to the Anaconda download page, pick the latest version of the Anaconda installer and run the following command to download it to your system. wget https://repo.anaconda.com/archive/Anaconda3-2021.05-Linux-x86_64.shOnce the download is completed, verify the data integrity of the installer using the following command: sha256sum Anaconda3-2021.05-Linux-x86_64.shYou should get the following output: 2751ab3d678ff0277ae80f9e8a74f218cfc70fe9a9cdc7bb1c137d7e47e33d53 Anaconda3-2021.05-Linux-x86_64.shNow, please copy the above output and check it against the hashes available at Anaconda Page.
Once your output matches with the hash displayed on the Anaconda page, you can install it using the following command: bash Anaconda3-2021.05-Linux-x86_64.shYou will be asked to review the license as shown below: Welcome to Anaconda3 2021.05 In order to continue the installation process, please review the license agreement. Please, press ENTER to continue >>> =================================== Do you accept the license terms? [yes|no] >>> yesType Yes and hit Enter to accept the license. You will be asked to specify the Anaconda location as shown below: Anaconda3 will now be installed into this location: /root/anaconda3 - Press ENTER to confirm the location - Press CTRL-C to abort the installation - Or specify a different location below [/root/anaconda3] >>>Just press Enter to continue with the default location. You will be asked to initialize the Anaconda as shown below: Preparing transaction: done Executing transaction: done installation finished. Do you wish the installer to initialize Anaconda3 by running conda init? [yes|no] [no] >>> yesType yes and hit Enter. Once the installation has been completed, you should see the following output: no change /root/anaconda3/condabin/conda no change /root/anaconda3/bin/conda no change /root/anaconda3/bin/conda-env no change /root/anaconda3/bin/activate no change /root/anaconda3/bin/deactivate no change /root/anaconda3/etc/profile.d/conda.sh no change /root/anaconda3/etc/fish/conf.d/conda.fish no change /root/anaconda3/shell/condabin/Conda.psm1 no change /root/anaconda3/shell/condabin/conda-hook.ps1 no change /root/anaconda3/lib/python3.8/site-packages/xontrib/conda.xsh no change /root/anaconda3/etc/profile.d/conda.csh modified /root/.bashrc ==> For changes to take effect, close and re-open your current shell. 4.10.3-py38h06a4308_0 The following packages will be DOWNGRADED: xmltodict 0.12.0-py_0 --> 0.12.0-pyhd3eb1b0_0 Proceed ([y]/n)? y How to Create Anaconda EnvironmentsAnaconda allows you to create a virtual environment to keep projects organized by Python versions. You can use different Python versions for each Anaconda environment. Before creating a Virtual environment, check all available Python versions using the following command: (base) [email protected]:~# conda search "^python$"Now, let's create a new Anaconda environment named myenv using the Python version 3: (base) [email protected]:~# conda create --name myenv python=3You should see the following output: Proceed ([y]/n)? y Downloading and Extracting Packages openssl-1.1.1l | 2.5 MB | #################################################################################################### | 100% pip-21.2.4 | 1.8 MB | #################################################################################################### | 100% _openmp_mutex-4.5 | 22 KB | #################################################################################################### | 100% sqlite-3.36.0 | 990 KB | #################################################################################################### | 100% libgcc-ng-9.3.0 | 4.8 MB | #################################################################################################### | 100% libstdcxx-ng-9.3.0 | 3.1 MB | #################################################################################################### | 100% libgomp-9.3.0 | 311 KB | #################################################################################################### | 100% ld_impl_linux-64-2.3 | 586 KB | #################################################################################################### | 100% ca-certificates-2021 | 113 KB | #################################################################################################### | 100% tzdata-2021a | 111 KB | #################################################################################################### | 100% wheel-0.37.0 | 33 KB | #################################################################################################### | 100% setuptools-52.0.0 | 724 KB | #################################################################################################### | 100% certifi-2021.5.30 | 139 KB | #################################################################################################### | 100% python-3.9.6 | 18.4 MB | #################################################################################################### | 100% Preparing transaction: done Verifying transaction: done Executing transaction: done # # To activate this environment, use # # $ conda activate myenv # # To deactivate an active environment, use # # $ conda deactivateNext, activate your environment using the following command: (base) [email protected]:~# conda activate myenvNext, verify which version of Python you are using: (myenv) [email protected]:~# python --versionYou should see the following output: Python 3.9.6To deactivate from your environment, run the following command: (myenv) [email protected]:~# conda deactivateYou should see the following output: (base) [email protected]:~#To list all Anaconda environments that you have set up, run the following command: (base) [email protected]:~# conda info --envsYou should see the following output: # conda environments: # base * /root/anaconda3 myenv /root/anaconda3/envs/myenvTo remove myenv environment, run the following command: (base) [email protected]:~# conda env remove -n myenvYou should see the following output: Remove all packages in environment /root/anaconda3/envs/myenv: Uninstall AnacondaTo remove the Anaconda completely from your system, you will need to install the anaconda-clean module to your system. You can install it using the following command: (base) [email protected]:~# conda install anaconda-cleanOnce the installation is complete, you should get the following output: Collecting package metadata (current_repodata.json): done Solving environment: done ## Package Plan ## environment location: /root/anaconda3 added / updated specs: - anaconda-clean The following packages will be downloaded: package | build ---------------------------|----------------- anaconda-clean-1.1.0 | py38h06a4308_1 244 KB ------------------------------------------------------------ Total: 244 KB The following NEW packages will be INSTALLED: anaconda-clean pkgs/main/linux-64::anaconda-clean-1.1.0-py38h06a4308_1 Proceed ([y]/n)? yNow, uninstall Anaconda from your system using the following command: (base) [email protected]:~# anaconda-cleanYou will be asked to delete Anaconda from your system as shown below: Delete .conda? (y/n): yType y and hit Enter to uninstall the Anaconda. Next, remove the Anaconda directory using the following command: rm -rf ~/anaconda3Next, edit the .bashrc file with the following command: nano ~/.bashrcScroll down and remove the following lines: # >>> conda initialize >>> # !! Contents within this block are managed by 'conda init' !! __conda_setup="$('/root/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)" if [ $? -eq 0 ]; then eval "$__conda_setup" else if [ -f "/root/anaconda3/etc/profile.d/conda.sh" ]; then . "/root/anaconda3/etc/profile.d/conda.sh" else export PATH="/root/anaconda3/bin:$PATH" fi fi unset __conda_setup # |
CopyRight 2018-2019 实验室设备网 版权所有 |